package locations.actions;

import java.util.ArrayList;
import java.util.List;

import locations.dao.DAOFactory;
import locations.dao.PacientDAO;
import locations.model.Pacient;

import com.opensymphony.xwork2.ActionSupport;


public class PacientIndexAction extends ActionSupport {
	
	private List<Pacient> pacients = new ArrayList();
	
	public String execute() throws Exception {
		
		PacientDAO dao = DAOFactory.getPacientDAO();
		this.setPacients(dao.retrieveAll());
		return SUCCESS;
	}
	
	public List<Pacient> getPacients() {
		return pacients;
	}

	public void setPacients(List<Pacient> pacients) {
		this.pacients = pacients;
	}
}
